var fs = require('fs');

module.exports = {
	readFileSync:function(){
		var data = fs.readFileSync('../../front/index.html','utf-8');
		console.log(data);
	},
	readFileSyncOutput:function(res){
		var data = fs.readFileSync('../../front/index.html','utf-8');
		res.write(data);
	},
	readFile:function(file,res){
		var data = fs.readFile(file,'utf-8',function(err,data){
			res.write(data);
			res.end();
		});
	},
	writeFile:function(file,res){
		fs.writeFile(file,'这里是文件的内容',function(err){
			if (err) throw err;
			res.write('写入成功!');
			red.end();
		})
	}
};
